# Contributor: August Klein <amatcoder@gmail.com>
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=meld
pkgver=3.21.1
pkgrel=1
pkgdesc="A visual diff and merge tool"
url="https://meldmerge.org"
arch="noarch"
license="GPL-2.0-or-later"
depends="
	dconf
	gsettings-desktop-schemas
	gtksourceview4
	py3-cairo
	py3-gobject3
	python3
	"
makedepends="
	glib-dev
	gtksourceview4-dev
	intltool
	itstool
	libxml2-utils
	meson
	py3-cairo-dev
	py3-gobject3-dev
	python3-dev
	"
checkdepends="
	gtk-update-icon-cache
	py3-pytest
	xvfb-run
	"
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.gnome.org/sources/meld/${pkgver%.*}/meld-$pkgver.tar.xz
	0001-Use-gettext-module.patch
	fix-meson-pyc-compile.patch
	meson-0.60.patch
	"

build() {
	abuild-meson . output
	meson compile -C output
}

check() {
	xvfb-run meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
b73a573b3b768f2f8ad664ab4da7dc8ed0ca31203dbfb523bf374dd0a2ff5ef6d6264296b257373abcd4084c97dbecd3090ef768eecc5dc13b01752522fbe048  meld-3.21.1.tar.xz
8b44f622beb5422ab8714b611b81eef355272882cdcfd79b2a6b9e91cc52f202195eee94ae85931a7952beec66cb6c523ab33c54e2bebde9a29b2ab2cc738411  0001-Use-gettext-module.patch
f547944e42ea8a2008f960d58c8a359f2d50ab5b408b8568c2d2aed0a9ea42390f3e5b425816735e024b888d1ae7f2c8fc16422f487f23b141e0720091280cec  fix-meson-pyc-compile.patch
d71500fa8ab1b5f7851e7ed3345494e04d89a4b6c7c65d05023996ea96c77c69a6a139b1ef102144dec2a6a5e0832b41f2cfcfd3a98954d8ab35594feee9503c  meson-0.60.patch
"
